﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.ComponentModel.Design;

namespace IESN.IESNControl
{
    public partial class ProcessInfoCombox : ComboBox
    {
        public ProcessInfoCombox()
        {
            InitializeComponent();

            InitCombox();
        }

        public ProcessInfoCombox(IContainer container)
            :this()
        {
            container.Add(this);
        }

        /// <summary>
        /// 初始化
        /// </summary>
        private void InitCombox()
        {
            if (this.GetService(typeof(IDesignerHost)) != null || System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime)
            {
                //设计时
            }
            else
            {
                //运行时
                DataSet ds = IESN.DAL.AccessDBHelper.GetDataSetByTableName("process_header");

                if (ds.Tables.Count > 0)
                {
                    this.DataSource = ds.Tables[0];
                    this.ValueMember = "ID";
                    this.DisplayMember = "ProcessNo";
                }
            }
        }

    }
}
